package ar.uade.edu.fain.ad.server.dao.jpa;

import ar.uade.edu.fain.ad.server.business.Mozo;
import ar.uade.edu.fain.ad.server.business.Salon;
import ar.uade.edu.fain.ad.server.dao.MozoDAO;
import ar.uade.edu.fain.ad.server.dao.entity.MozoEntity;

public class MozoJpaDAO 
		extends GenericJpaDAO<Mozo, MozoEntity, Long>
		implements MozoDAO {

	public MozoJpaDAO() {
		super(MozoEntity.class);
	}

	@Override
	protected MozoEntity toEntity(Mozo business) {
		return null;
	}

	@Override
	protected Mozo toBusiness(MozoEntity entity) {
		Mozo business = new Mozo();
		business.setId(entity.getId());
		business.setLogin(entity.getLogin());
		business.setNombre(entity.getNombre());
		business.setPassword(entity.getPassword());
		business.setApellido(entity.getApellido());
		Salon salon = new Salon();
		salon.setId(entity.getArea().getId());
		business.setArea(salon);
		return business;
	}

}
